package com.orhon.smartcampus.modules.teacher.inputMapper;

import java.util.Map;

import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import com.alibaba.fastjson.JSON;
import com.orhon.smartcampus.basicComponents.ConvertHelper;
import com.orhon.smartcampus.modules.teacher.gqlInputModel.GQLWorkExperienceInput;

@Mapper(uses = {
        ConvertHelper.class
})
public interface WorkExperienceInputMapper {


    WorkExperienceInputMapper MAPPER = Mappers.getMapper(WorkExperienceInputMapper.class);

    default GQLWorkExperienceInput mapInput(final Map map){
        String json = JSON.toJSONString(map);
        GQLWorkExperienceInput input = JSON.parseObject(json , GQLWorkExperienceInput.class);
        return input;
    }
}
